<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            font-size: 20px;
            font-weight: bold;
            margin: 0 auto;
        }
        th{
            border: 1px solid ; 
            text-align: center;   
        }
        td{
            border: 1px solid ;
            text-align: center;
        }
        .box3{
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <script>
        let eb=prompt("请输入电费：")
        let wb=prompt("请输入水费：")
        let ib=prompt("请输入网费：")
        let num=+prompt("请输入总金额：")
        let rnum=num-eb-wb-ib
        document.write(`<table class="box3" cellspacing="0">
        <caption class="box1">2020年12月消费支出</caption>
        <tr>
            <th>银行卡余额</th>
            <th>水费</th>
            <th>电费</th>
            <th>网费</th>
            <th>银行卡余额</th>
        </tr>
        <tr>
            <td>${num}元</td>
            <td>${wb}元</td>
            <td>${eb}元</td>
            <td>${ib}元</td>
            <td>${rnum}元</td>
        </tr>
    </table>`)      
    </script>
</body>
</html>